﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
 
using System.Text;
using System.Windows.Forms;
using FarPoint.Win.Spread;

namespace Demo
{
    public partial class MultipleHearders : DemoBaseUserControl
    {
        public MultipleHearders()
        {
            InitializeComponent();
            this.Title = "多表头";
            this.Description = "Spread .NET  可以在表头上定义任意多的行和列。";
        }

        public void InitSpread()
        {
            FpSpread1.Sheets[0].ColumnHeader.RowCount = 2;
            FpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "销售信息";
            FpSpread1.Sheets[0].Models.ColumnHeaderSpan.Add(0, 0, 1, 8);

            FpSpread1.Sheets[0].RowHeader.ColumnCount = 2;
            FpSpread1.Sheets[0].Models.RowHeaderSpan.Add(0, 0, this.FpSpread1_Sheet1.RowCount, 1);
            FpSpread1.Sheets[0].RowHeader.Cells[0, 0].Text = "编号";

            //Add span
        }

        private void MultipleHearders_Load(object sender, EventArgs e)
        {
            FpSpread1.DataSource = 销售明细表TableAdapter.GetData();
            InitSpread();
        }
    }
}
